<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>exists</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>exists</b> -  checks variable  existence</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>exists(name [,where])  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>name</b>
        </tt>: a character string</li>
      <li>
        <tt>
          <b>where</b>
        </tt>: an optional character string with default value <tt>
          <b>'all'</b>
        </tt>
      </li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      <tt>
        <b>exists(name)</b>
      </tt> returns <tt>
        <b>1</b>
      </tt> if the variable named <tt>
        <b>name</b>
      </tt>
    exists and <tt>
        <b>0</b>
      </tt> otherwise.</p>
    <p>
    Caveats: a function which uses <tt>
        <b>exists</b>
      </tt> may return a result which depends on the environment!</p>
    <p>
      <tt>
        <b>exists(name,'local')</b>
      </tt> returns <tt>
        <b>1</b>
      </tt> if the variable named
    <tt>
        <b>name</b>
      </tt> exists in the local environment of the current function and
    <tt>
        <b>0</b>
      </tt> otherwise.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

deff('foo(x)',..
['disp([exists(''a12''),exists(''a12'',''local'')])'
 'disp([exists(''x''),exists(''x'',''local'')])'])
foo(1)
a12=[];foo(1)
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="../elementary/isdef.htm">
        <tt>
          <b>isdef</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="whereis.htm">
        <tt>
          <b>whereis</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="type.htm">
        <tt>
          <b>type</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../elementary/typeof.htm">
        <tt>
          <b>typeof</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../functions/macrovar.htm">
        <tt>
          <b>macrovar</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
